In IT and electronic communication fields, in order to improve the reliability of the operation of an apparatus and enhance the maintainability of the apparatus, a diagnostic detection will generally be performed on the apparatus. If there is an error, relevant error information will be output, and a maintenance operation will be subsequently performed on the apparatus based on the error information.
An apparatus based on X86 architecture firstly performs initialization and diagnosis of hardware devices via a BIOS (Basic Input Output System) or EFI (Extensible Firmware Interface) startup system, and then enters the operating system. Taking the BIOS startup as an example, in order to perform a diagnosis on the hardware devices, a method is often used in the prior art wherein a debug program is added into the BIOS, and debug information is output to the 0x80 port by running the debug program. The diagnostic information is generally simple and gives a small amount of information, and it is impossible to make a more accurate judgment on the fault.
To obtain more accurate diagnostic information, in the prior art, a special diagnostic program is operated in the operating system or is triggered through a specified key in the BIOS startup stage to perform a diagnostic detection. See FIG. 1, after the system is powered up, the BIOS program is executed. Firstly, a processor such as a central processing unit (CPU) is initialized, and then devices like memory, PCI/PCIE and VGA are initialized. Next, it is judged whether there is a specified key being pressed, and if yes, a diagnostic mode is entered to perform a diagnosis, including diagnosis of keyboard, memory, PCI devices, hard disk, etc. If there is no specified key being pressed, the BIOS startup is continued and OS is entered. Since devices such as the memory and VGA have been initialized before the diagnostic mode is entered, information is displayed in detail through a display after the diagnosis is completed. In this way, the user can locate the fault of the apparatus more accurately, making the maintenance more convenient.
The inventors, when making the present disclosure, found that the prior art at least has the following disadvantages.
When using 0x80 port debug, the output information is generally too simple and it is impossible to make an accurate judgment on the fault. Meanwhile, when using the special diagnostic program, since it is operated in the operating system or is operated in the BIOS startup stage, when a fault occurs in the memory or PCI/PCIE (Peripheral Component Interconnect/Peripheral Component Interconnect Express), devices such as the display and the keyboard generally cannot be used, the diagnostic functions cannot be realized.